package domain.services;

import domain.entities.OperationRecord;
import infrastructure.Repository;
import org.apache.log4j.Logger;

import java.util.Collection;

/**
 * 操作记录领域服务
 *
 * @author wyl
 */
public final class OperationRecordDomainService {
    public static OperationRecordDomainService Instance = new OperationRecordDomainService();
    private final Logger logger = Logger.getLogger(this.getClass());
    private Repository<OperationRecord> repository;

    public OperationRecordDomainService() {
        try {
            this.repository = new Repository<OperationRecord>() {
            };
        } catch (Exception e) {
            System.out.println("OperationRecordDomainService创建失败");
            e.printStackTrace();
        }
    }


    public boolean add(OperationRecord record) {
        return repository.add(record);
    }

    public Collection<OperationRecord> getAllRecord() {
        return repository.queryAll();
    }


}
